from django.db import models


class CsCarts(models.Model):
    shop_id = models.PositiveIntegerField()
    cashier_id = models.PositiveIntegerField(default=0)
    barcode = models.CharField(max_length=50, blank=True, null=True)
    sig_barcode = models.CharField(default='', max_length=50, blank=True, null=True)
    goods_id = models.PositiveIntegerField()
    class_id = models.PositiveIntegerField(default=0)
    class_name = models.CharField(max_length=16)
    member_id = models.PositiveIntegerField()
    bill_num = models.CharField(max_length=20)
    goods_name = models.CharField(max_length=100)
    selling_price = models.DecimalField(max_digits=10, decimal_places=2)
    is_input_price = models.IntegerField(default=0)
    is_discount = models.IntegerField(default=0)
    is_half = models.PositiveIntegerField(default=0)
    unit_price = models.DecimalField(max_digits=10, decimal_places=2)
    amount = models.DecimalField(max_digits=12, decimal_places=3)
    subtotal = models.DecimalField(max_digits=10, decimal_places=2)
    spec_typ = models.IntegerField(default=0)
    err = models.TextField(blank=True, null=True)
    cart_typ = models.IntegerField(default=0)
    status = models.IntegerField(default=0)
    created = models.PositiveIntegerField()
    updated = models.PositiveIntegerField()
    deleted = models.PositiveIntegerField(default=0)
    remark = models.CharField(default='', max_length=200, blank=True, null=True)
    drink_type = models.PositiveIntegerField(default=1)
    drink_flavor = models.CharField(default='', max_length=255, blank=True, null=True)
    class Meta:
        managed = False
        db_table = 'cs_carts'
